<?php
class Zend_View_Helper_ValError extends Zend_View_Helper_Abstract
{
    public $view;

    public function valError($arg1,$arg2='')
    {
        return is_array($this->view->errors[$arg1]) ?
               $this->view->translate(current($this->view->errors[$arg1])) :
               $this->view->translate($arg2);
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}
?>